#!/bin/sh

[ -f profile.sh ] && source profile.sh

cat > build.go <<EOF
// 本文件是自动编译生成的,请不要手动编辑
// 生成时间: `date`
package main
const serverRsaPrivateKey = \`${SERVER_RSA_PRIVATE_KEY}\`
const (
	innerServerAddr = "${INNER_SERVER_ADDR}"
	innerServerUser = "${INNER_SERVER_USER}"
	innerServerPass = "${INNER_SERVER_PASS}"
)
EOF

# 编译本地版本
go build

# 交叉编译Windows 64位版本
GOOS=windows GOARCH=amd64 go build
